import java.io.UnsupportedEncodingException;
import java.nio.charset.Charset;
import java.util.Locale;
import java.util.stream.IntStream;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:DELL
 * Date:2024-10-19
 * Time:23:23
 */
class Animal{
    public String name;
    public int age;

    public Animal(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public void eat(){
        System.out.println(name+"正在吃!");
    }

    @Override
    public String toString() {
        return "Animal{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}

class Dog extends Animal{
    public Dog(String name, int age) {
        super(name, age);
    }

    public void wangWang(){
        System.out.println(name+"正在汪汪汪！");
    }
}

class Bird extends Animal{
    public Bird(String name, int age) {
        super(name, age);
    }
    public void fly(){
        System.out.println(name+"正在飞！");
    }

}
public class Test {
    public static void eat(Animal a) {
    a.eat();
    }
    public static void main(String[] args) {
        Dog dog=new Dog("小狗",3);
        dog.eat();
        dog.wangWang();
        System.out.println("============");
        Animal animal=new Animal("animal",10);
        animal.eat();

        eat(dog);
    }
}
